from applications.extensions import ma
from marshmallow import fields


# 用户models的序列化类
class admin_iptvadmin_channel_webOutSchema(ma.Schema):
    id = fields.Integer()
    name = fields.Str()
    category = fields.Str()
    url = fields.Str()
    create_time = fields.DateTime()


# 分类models的序列化类
class admin_iptvadmin_category_webOutSchema(ma.Schema):
    id = fields.Integer()
    name = fields.Str()
    sort = fields.Integer()
    create_time = fields.DateTime()

# rss订阅models的序列化类
class admin_iptvadmin_rss_webOutSchema(ma.Schema):
    id = fields.Integer()
    name = fields.Str()
    type = fields.Str()
    url = fields.Str()
    category = fields.Str()
    status = fields.Boolean()
    encrypt = fields.Boolean()
    sort = fields.Integer()
    # update_interval = fields.Integer()
    last_update = fields.DateTime()
    enable = fields.Boolean()
    remark = fields.Str()
    create_time = fields.DateTime()
    update_time = fields.DateTime()
    
# 客户端上线日志models的序列化类
class admin_iptvadmin_client_log_webOutSchema(ma.Schema):
    id = fields.Integer()
    client_id = fields.Str()
    client_version = fields.Str()
    client_ip = fields.Str()
    client_model = fields.Str()
    client_system = fields.Str()
    last_login = fields.DateTime()
    create_time = fields.DateTime()

# 客户端设备表models的序列化类
class admin_iptvadmin_client_webOutSchema(ma.Schema):
    # id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键ID')
    # androidId = db.Column(db.String(100), nullable=True, comment='安卓ID')
    # deviceBrand = db.Column(db.String(100), nullable=True, comment='设备品牌')
    # deviceName = db.Column(db.String(100), nullable=True, comment='设备名称')
    # deviceOsVer = db.Column(db.String(100), nullable=True, comment='设备系统版本')
    # deviceMac = db.Column(db.String(100), nullable=True, comment='设备MAC')
    # sdkVer = db.Column(db.String(100), nullable=True, comment='SDK版本')
    # apkAppName = db.Column(db.String(100), nullable=True, comment='APP名称')
    # apkPackageName = db.Column(db.String(100), nullable=True, comment='APP包名')
    # apkVer = db.Column(db.String(100), nullable=True, comment='APP版本')
    # sign = db.Column(db.String(100), nullable=True, comment='签名')
    # authorize = db.Column(db.Boolean, default=False, comment='授权状态')
    # config_file = db.Column(db.String(100), nullable=True, default='default.json', comment='配置文件') 
    # create_time = db.Column(db.DateTime, default=datetime.now, comment='创建时间')
    # update_time = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')

    id = fields.Integer()
    androidId = fields.Str()
    deviceBrand = fields.Str()
    deviceName = fields.Str()
    deviceOsVer = fields.Str()
    deviceMac = fields.Str()
    sdkVer = fields.Str()
    apkAppName = fields.Str()
    apkPackageName = fields.Str()
    apkVer = fields.Str()
    sign = fields.Str()
    authorize = fields.Boolean()
    config_file = fields.Str()
    create_time = fields.DateTime()
    update_time = fields.DateTime()
